package lin.j4fun.utility;

import java.util.Properties;

public class SystemConfig {
	private static Properties configProp = null;

	static {
		configProp = new Properties();
		try {
			configProp.load(SystemConfig.class.getClassLoader().getResourceAsStream("SystemConfig.properties"));
		} catch (Exception e) {
			//SystemConfig.properties LoadProperties Failure
		}
	}

	public static String getStringConfig(String key) {
		return configProp.getProperty(key);
	}
	
	public static boolean getBooleanConfig(String key) {
		if(configProp.getProperty(key).equalsIgnoreCase("true")){
			return true;
		}else{
			return false;
		}		
	}
	public static int getIntConfig(String key) {
		int value = 0;
		try{
			value = Integer.parseInt(configProp.getProperty(key));
		}catch(Exception e){
			e.printStackTrace();
		}
		return value;
	}
}
